package it.koutifaris.travianmap.model;

/**
 * Tribe Enum:<br/>
 * TID: The tribe number. 1 = Roman, 2 = Teuton, 3 = Gaul, 4 = Nature and 5 = Natars
 * 
 * @author Kouty
 * 
 */
public enum Tribe {
	ROMAN,
	TEUTON,
	GAUL,
	NATURE,
	NATARS;

	public static Tribe valueOf(int id) {
		if (id <= 0 || id > Tribe.values().length) {
			throw new IllegalArgumentException("Invalid tribe id! Must be between 1 and " + Tribe.values().length);
		}

		return Tribe.values()[id - 1];
	}
}
